﻿ #region Disclaimer/Info
 
 /////////////////////////////////////////////////////////////////////////////////////////////////
 //
 //   File:		ServiceInstaller.cs
 //   Website:		http://dexterblogengine.com/
 //   Authors:		http://dexterblogengine.com/About.ashx
 //   Rev:		1
 //   Created:		19/01/2011
 //   Last edit:		19/01/2011
 //   License:		GNU Library General Public License (LGPL)
 // 
 //   For updated news and information please visit http://dexterblogengine.com/
 //   Dexter is hosted to Codeplex at http://dexterblogengine.codeplex.com
 //   For any question contact info@dexterblogengine.com
 //
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 #endregion

using Dexter.Dependency;
using Dexter.Dependency.Installation;

namespace Dexter.Services.Implementation.LayerInstaller {
	/// <summary>
	/// 	Implementation of <see cref = "ILayerInstaller" /> for the layer <see cref = "Dexter.Core.Domain.Services" />.
	/// </summary>
	public class ServiceInstaller : ILayerInstaller {
		#region ILayerInstaller Members

		/// <summary>
		/// 	Installs all the component needed by the assembly.
		/// </summary>
		/// <param name = "container">The container.</param>
		public void ServiceRegistration ( IDexterContainerRegister container ) {
			container.Register <IBlogRollService , BlogRollService> ( "BlogRollService" , LifeCycle.Singleton );
			container.Register <ICategoryService , CategoryService> ( "CategoryService" , LifeCycle.Singleton );
			container.Register <ICommentService , CommentService> ( "CommentService" , LifeCycle.Singleton );
			container.Register <IConfigurationService , ConfigurationService> ( "ConfigurationService" , LifeCycle.Singleton );
			container.Register <IEmailService , EmailService> ( "EmailService" , LifeCycle.Singleton );
			container.Register <IPostService , PostService> ( "PostService" , LifeCycle.Singleton );
			container.Register <ITagService , TagService> ( "TagService" , LifeCycle.Singleton );
			//container.Register<IUserNotificationService, UserNotificationService> ( "UserNotificationService", LifeCycle.Singleton );
			container.Register <IUserService , UserService> ( "UserService" , LifeCycle.Singleton );
			container.Register<ILegacyUrlService, LegacyUrlService>("LegacyUrlService", LifeCycle.Singleton);
			container.Register <IReferrerService , ReferrerService> ( "ReferrerService" , LifeCycle.Singleton );
			container.Register <IPageService , PageService> ( "PageService" , LifeCycle.Singleton );
			container.Register<IUrlBuilderBase, UrlBuilderBase> ( "UrlBuilderRoot", LifeCycle.Singleton );
			container.Register<IPageUrlBuilder, PageUrlBuilder> ( "PageUrlBuilder", LifeCycle.Singleton );
			container.Register<IPostUrlBuilder, PostUrlBuilder> ( "PostUrlBuilder", LifeCycle.Singleton );
			container.Register<ICommentUrlBuilder, CommentUrlBuilder> ( "CommentUrlBuilder", LifeCycle.Singleton );
			container.Register<ICategoryUrlBuilder, CategoryUrlBuilder> ( "CategoryUrlBuilder", LifeCycle.Singleton );
			container.Register<ITagUrlBuilder, TagUrlBuilder> ( "TagUrlBuilder", LifeCycle.Singleton );
			container.Register<IUrlBuilder, UrlBuilder> ( "UrlBuilder", LifeCycle.Singleton );
			container.Register<IBackOfficeUrlBuilder, BackOfficeUrlBuilder> ( "BackOfficeUrlBuilder", LifeCycle.Singleton );
			container.Register<IBlogTheme, BlogTheme> ( "BlogTheme", LifeCycle.Singleton );
			container.Register<IThemeManager, ThemeManager> ( "ThemeManager", LifeCycle.Singleton );
			container.Register<IUserUrlBuilder, UserUrlBuilder> ( "UserUrlBuilder", LifeCycle.Singleton );
			container.Register<IContactService, ContactService> ( "ContactService", LifeCycle.Singleton );
			container.Register<IEmailTemplateService, EmailTemplateService> ( "EmailTemplateService", LifeCycle.Singleton );
			container.Register<IExportUrlBuilder, ExportUrlBuilder> ( "ExportUrlBuilder", LifeCycle.Singleton );
			container.Register<ISetupService, SetupService> ( "SetupService", LifeCycle.Singleton );
			container.Register<ISetupControl, SetupService> ( "SetupControl", LifeCycle.Singleton );
			container.Register<ICommentExport, CommentExport>("CommentExport", LifeCycle.Singleton);
			container.Register<IPluginService, PluginService>("PluginService", LifeCycle.Singleton);
			container.Register<IImportService, ImportService>("ImportService", LifeCycle.Singleton);
			//container.Register<IImportService, ImportServiceWordpress>("ImportServiceWordpress", LifeCycle.Singleton);
		}

		/// <summary>
		/// 	Setups the service.
		/// </summary>
		/// <param name = "container">The container.</param>
		public void ServiceRegistrationComplete ( IDexterContainerResolver container ) { }

		/// <summary>
		/// Setups the service.
		/// </summary>
		/// <param name="container">The container.</param>
		public void ApplicationStarted ( IDexterContainerResolver container ) {
		}

		#endregion
	}
}
